import torch


# 假设Config类中有以下参数需要调整
class Config:
    # 训练参数
    EPOCHS = 100  # 增加轮次
    BATCH_SIZE = 32  # 调整批次大小
    INITIAL_LR = 3e-4  # 调整学习率
    
    # 早停参数
    PATIENCE = 15  # 增加耐心值
    MIN_DELTA = 0.001  # 调整最小改进阈值
    
    # 损失权重
    SUBJ_WEIGHT_START = 0.9  # 主语任务初始权重
    SUBJ_WEIGHT_END = 0.7  # 主语任务最终权重
    
    # 模型参数
    EMBED_DIM = 300  # 增加嵌入维度
    HIDDEN_DIM = 256  # 增加隐藏层维度
    N_HEADS = 8
    DROPOUT = 0.3  # 增加dropout
    
    # 类别权重 - 保持平衡
    CLASS_WEIGHTS = [1.0, 1.0]

    # 文本参数
    MAX_LEN = 30

    # 模型参数
    # Add INTENT_CLASSES attribute
    INTENT_CLASSES = ["咨询", "投诉", "表扬", "建议", "求助"]
    
    # Ensure EMBED_DIM and HIDDEN_DIM are defined
    EMBED_DIM = 200
    HIDDEN_DIM = 256
    
    # Add other necessary attributes
    DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
    DATA_PATH = '/Users/tony/work/python_workspace/train_min_model/data/data.csv'
    MODEL_PATH = '/Users/tony/work/python_workspace/train_min_model/model/model.pth'
    BATCH_SIZE = 32
    EPOCHS = 50
    INITIAL_LR = 1e-3
    MAX_LEN = 128
    MIN_DELTA = 0.01
    PATIENCE = 3
    MODEL_PATH = "v2/enhanced_model.pth"
    DATA_PATH = "augmented_data.csv"
    USER_DICT = "user_dict.txt"

    # 设备配置
    DEVICE = "mps" if torch.backends.mps.is_available() else "cpu"

    # 类别权重
    CLASS_WEIGHTS = [1.0, 1.8]  # [positive, negative]

    # 动态损失权重参数
    SUBJ_WEIGHT_START = 0.8
    SUBJ_WEIGHT_END = 0.5